<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditCommentTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditCommentLabel_cid}" for="cid" />
                    <h:inputText id="cid" value="#{commentController.selected.cid}" title="#{bundle.EditCommentTitle_cid}" required="true" requiredMessage="#{bundle.EditCommentRequiredMessage_cid}"/>
                    <h:outputLabel value="#{bundle.EditCommentLabel_comment}" for="comment" />
                    <h:inputTextarea rows="4" cols="30" id="comment" value="#{commentController.selected.comment}" title="#{bundle.EditCommentTitle_comment}" required="true" requiredMessage="#{bundle.EditCommentRequiredMessage_comment}"/>
                    <h:outputLabel value="#{bundle.EditCommentLabel_sid}" for="sid" />
                    <h:selectOneMenu id="sid" value="#{commentController.selected.sid}" title="#{bundle.EditCommentTitle_sid}" required="true" requiredMessage="#{bundle.EditCommentRequiredMessage_sid}">
                        <f:selectItems value="#{spotController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditCommentLabel_username}" for="username" />
                    <h:selectOneMenu id="username" value="#{commentController.selected.username}" title="#{bundle.EditCommentTitle_username}" required="true" requiredMessage="#{bundle.EditCommentRequiredMessage_username}">
                        <f:selectItems value="#{userController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{commentController.update}" value="#{bundle.EditCommentSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditCommentViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{commentController.prepareList}" value="#{bundle.EditCommentShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditCommentIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
